
angular.module('U9ImHd.controllers')

.controller('InstalledAppCtrl', ['$scope', 'AppManager', function ($scope, AppManager) {
    $scope.data = {};

    $scope.data.gridOptions = {
        columnDefs: [ 
            { col: 'AppID', name: 'AppID' },
            { col: 'Name', name: '名称' },
            { col: 'Version', name: '版本' },
            { col: 'NoWorkStation', name: '工位绑定' }
        ],
        data: []
    };

    init();

    function init () {
        var apps = AppManager.getApps();
        angular.forEach(apps, function (app) {
            app.NoWorkStation = app.NoWorkStation ? '不需要' : '需要';
        });
        $scope.data.gridOptions.data = apps;
    }
}]);